<!DOCTYPE html>
<html>
<head>
  <script src="../node_modules/angular/angular.js"></script>
</head>
<body ng-app="todoApp">
  <div ng-controller="todoController">
    <input type="text" ng-model="curItem.content">
    <button ng-click="addItem()">Add</button>
    <ul>
      <li ng-repeat="item in todoList">{{ item.content }}</li>
    </ul>
  </div>
  <script>
    angular.module('todoApp', [])
      .controller('todoController', function($scope) {
        $scope.curItem = { content: '' };
        $scope.todoList = [{ 
          content: 'write a doc',
          time: new Date().toLocaleString()
        }];

        $scope.addItem = function() {
          $scope.todoList.push({
            ...$scope.curItem,
            time: new Date().toLocaleString()
          });
          $scope.curItem.content = ''
        }
      })
  </script>
</body>
</html>